<?php
/*
	@version		$Id: template_config.php 76 2010-01-22 00:50:31Z bulletprooftemplates $
	@copyright		Copyright (C) 2007-2010 Waseem Sadiq. All rights reserved.
	@license		Single Domain License
*/


/*
	Additional Template Functionality

	@package		Joomla!
	@subpackage		1.5
	@version		1.5
*/

defined('_JEXEC') or die('Restricted access');
	
/* 
	check if left or right modules are published 
*/
$leftcolumn = $this->countModules('left');
$rightcolumn = $this->countModules('right');

$left = ($leftcolumn ? 1 : 0);
$right = ($rightcolumn ? 1 : 0);

/* Set style type based on column layout */
if ($left &! $right) $style 	= "left-only";
if (!$left && $right) $style 	= "right-only";
if (!$left &! $right) $style 	= "wide";
if ($left && $right) $style 	= "both";

#--------------------------------------------------------------------------#
	
/* 
	Count the number of top teaser modules
	edit these lines to indicate which modules are in the top teaser block 
*/
$firsttopmodule = $this->countModules('user1');
$secondtopmodule = $this->countModules('user2');
$thirdtopmodule = $this->countModules('user4');
$fourthtopmodule = $this->countModules('user5');

#--------------------------------------------------------------------------#

$topmodule1 = ($firsttopmodule ? 1 : 0);
$topmodule2 = ($secondtopmodule ? 1 : 0);
$topmodule3 = ($thirdtopmodule ? 1 : 0);
$topmodule4 = ($fourthtopmodule ? 1 : 0);

$toptotal = ($topmodule1 + $topmodule2 + $topmodule3 + $topmodule4);

#--------------------------------------------------------------------------#

/* 
	Count the number of bottom teaser modules
	edit these lines to indicate which modules are in the bottom teaser block
*/
$firstbottommodule = $this->countModules('user6');
$secondbottommodule = $this->countModules('user7');
$thirdbottommodule = $this->countModules('user8');
$fourthbottommodule = $this->countModules('user9');

#--------------------------------------------------------------------------#

$bottommodule1 = ($firstbottommodule ? 1 : 0);
$bottommodule2 = ($secondbottommodule ? 1 : 0);
$bottommodule3 = ($thirdbottommodule ? 1 : 0);
$bottommodule4 = ($fourthbottommodule ? 1 : 0);

$bottomtotal = ($bottommodule1 + $bottommodule2 + $bottommodule3 + $bottommodule4);

#--------------------------------------------------------------------------#

/*
	Check if there's a page specific stylesheet and if there is return the link to the CSS file
*/
function getPageCssFile (){
global $mainframe;

$template = $mainframe->getTemplate();
$pagecssfile = "";

/*
	set the location of the page specific CSS file
	eg: the following line of code = templatepath\current-template\css\page-specific\pageNUMBER.css
*/
$page_specific_css_file = JPATH_THEMES.DS. $template .DS.'css'.DS.'page-specific'.DS.'page'. JRequest::getInt('Itemid', 0) .'.css';

/*
	Check to see if the page specific CSS file exists
*/
	if (file_exists($page_specific_css_file)) 

/*
	If the file exists output the link to the file
*/
	{

/*	
	edit the file path if you use a different folder for your page-specific CSS files
	eg: the following line of code = http://www.yourwebsite.com/templates/current-template/css/page-specific/pageNUMBER.css
*/
	$pagecssfile = '<link href="'. JURI::base() .'templates/' . $template .'/css/page-specific/page' . JRequest::getInt('Itemid', 0) .'.css" rel="stylesheet" type="text/css" media="screen" />';
}
	return $pagecssfile;
}

#--------------------------------------------------------------------------#

/*
	Check if there's a page specific index.php file and if there is return the output of that file
*/
function getPageIndexFile(){
global $mainframe;

$template = $mainframe->getTemplate();
$pageindexfile = "";

/*
	set the location of the page specific index.php file
	eg: the following line of code = templatepath\current-template\page-specific\pageNUMBER_index.php
*/
$page_specific_index_file = JPATH_THEMES.DS. $template .DS.'page-specific'.DS.'page'. JRequest::getInt('Itemid', 0) .'_index.php';

/*
	Check to see if the page specific index.php file exists
*/
	if (file_exists($page_specific_index_file)) 

/*
	If the file exists output the content of the file
*/
	{

/*	
	edit the file path if you use a different folder for your page-specific index.php files
		eg: the following line of code = http://www.yourwebsite.com/templates/current-template/page-specific/pageNUMBER_index.php
*/
	$pageindexfile = $page_specific_index_file;
}
	return $pageindexfile;
}

#--------------------------------------------------------------------------#
?>
